
ALTER proc [dbo].[GSP_GP_GetUserDayScore_Control]
  @dwUserID INT,
  @UserDaySocre INT OUTPUT
AS

  DECLARE @dwGameID INT = 0
  SELECT @dwGameID = ISNULL(GameID, 0) FROM AccountsInfo WHERE UserID=@dwUserID

  IF @dwGameID=0 BEGIN
    RETURN 3
  END

  DECLARE @StartTime datetime
  DECLARE @EndTime datetime
  DECLARE @ShareCount INT

  SET @StartTime = cast((select replace(CONVERT(varchar(12) , getdate(), 111 ),'/','-')) AS datetime)
  SET @EndTime = cast((select replace(CONVERT(varchar(12) , getdate(), 111 ),'/','-')+ ' 23:59:59') AS datetime)
  SET @ShareCount = ISNULL((SELECT sum([lSocre]) FROM [RYRecordDB].[dbo].[PrivateGameRecordUserRecordID] Where UserID=@dwUserID and InsertTime> @StartTime and InsertTime < @EndTime),0)
  SET @UserDaySocre = @ShareCount

  RETURN 0

